home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 2001 January / CT_SW0101.ISO / pc / software / kommunik / multimed / snakcarb.sit / Snak 4.6.3 Carbon / Scripts / • Read Me - Snak scripts < prev    next >
Text File  |  2000-11-05  |  7KB  |  85 lines

  1.  
  2.  
  3. Scrips for Snak  
  4.  
  5. Understanding scripting will give you a great set of new abilities and ways to use Snak. You use scripting to complement or even replace some of the built in commands with aliases to provide enhanced functionality. 
  6.  
  7. This Read Me file starts with a section introducing the scriptability of Snak and how it works, followed by an explanation of what each of the files in the Script folder do.
  8.  
  9. Introduction
  10. A script is a mini-program with variables and functions. An alias is one kind of a script, an entry in the Tools menu is another. An alias complements the built-in commands and is used the same way. With a script you can customize how the program works, and automate actions.
  11.  
  12. Snak supports two different scripting languages - AppleScript and ircII and come with extensive examples of scripts written in both languages. 
  13.  
  14. The two languages differ in their focus, their access to the internal data of Snak, their ease of use and their speed, but you can use scripts written in both languages side by side to get the most benefits of both environments.
  15.  
  16. Scripts are stored in files in the script folder, which is automatically created if missing. Scrips in the ircII language are regular text files that can be easily edited with a text editor, like BBEdit or even SimpleText. If you edit them in a word processor, please take care to save the files as pure text without formatting.
  17.  
  18. AppleScripts are created with the Script Editor application that comes with the Macintosh OS. There are also third party script editors and debuggers available that will let you examine a script while it is running to easily debug it. Important : The scripts must be saved in compiled form in order for Snak to use them. 
  19.  
  20. For both types of scripts, be sure not to include spaces in the filename under which you save them.
  21.  
  22. When you open a connection, the program will read in the contents of the basical and action ircII script files from the Script folder. These files contain aliases that extends the built-in command set and serves as examples of how to extend and modify Snaks behavior. The files have informative comments and explanations to help you understand what is going on.
  23.  
  24. Each connection maintains its own list of loaded scripts, so that you can modify the behavior and use of each connection. For example, one connection could be used to run a bot and another could be used normally.
  25.  
  26. Included with Snak is a complete ircII script package called PurePak, which contains extensive functionality for both channel operators and normal IRC users. It can maintain list of friends and enemies on IRC that can be set up to auto-op friends and try to avoid enemies. It has functions for channel management, and file exchange, and it comes with extensive built-in help. To load purepak, type "/load purepak.irc" and notice the intro messages that come up. The built-in help is accessed with /pphelp and an optional topic like /pphelp main.
  27.  
  28. Scripts can be complex multi-line programs like PurePak or they can simply be used to abbreviate frequently used commands.  It is too big a subject to cover in detail in this read me or the manual , so you are encouraged to study the example script files that come with the program to learn details. 
  29.  
  30. So many files..
  31. There are two different kinds of script files that Snak can use: text files containing scripts in the ircII language, and files containing a compiled AppleScript.
  32.  
  33. ircII scripts:
  34.  
  35. basical - this file is loaded automatically when a connection is opened. It contains many useful shortcut aliases like "/j" for join, op for "mode <channel> +o" etc. as well as useful snippets used in other script files.
  36.  
  37. action - this file is loaded automatically when a connection is opened. It contains a number of small aliases usually used to express emotions like "/snore" which will send "<yournick> snores loudly.." to the channel, or "/scratch" which will send "<yournick> scratches his head".
  38.  
  39. The PurePak script package consists of:
  40. purepak.irc - this is the main file of purepak, and the only one you need to load manually with "/load purepak.irc" if you want to use PurePak.
  41.  
  42. purepak.hlp - loaded automatically on demand - contains the help database for all the PurePak functions. To read the help and see what functions are available, type "/load purepak.irc" to load it and then "/pphelp" to get instructions.
  43.  
  44. pp-bots.irc - loaded automatically on demand - contains bot support functions - NOT CURRENTLY SUPPORTED BY SNAK
  45.  
  46. pp-kicks.irc - loaded automatically on demand - contains colorful kick messages that you can use if you are a channel operator
  47.  
  48. pp-dcc.irc - loaded automatically on demand - contains file server functions. Type "/pphelp bot" for help on file serving. Supported in Snak.
  49.  
  50. pp-silly.irc - loaded automatically on demand - as the name suggests this file contains funny ascii drawings and other stuff.
  51.  
  52. Read Me - PurePak - not a script file. The read me file that comes with PurePak.
  53.  
  54. AppleScripts:
  55.  
  56. CloneNoticeCatcher - useful script for server operators. Filters out unwanted notices from the channel text and displays them in a separate window.
  57.  
  58. countops - little script that calculates how many ops and regular users that are in a channel and displays the ratio.
  59.  
  60. idle1 and idle 2 - sample scripts that illustrate how Snak supports multiple scripts sharing the same idle handler. Instructions inside the file.
  61.  
  62. input1 and input 2 - sample scripts that illustrate how Snak supports multiple scripts sharing the same event handler. Instructions inside the file.
  63.  
  64. matchtest - small sample script that illustrates Snaks support for the "match" event that can eliminate much laborious text processing in scripts.
  65.  
  66. movewindow - small sample script that shows how to move Snaks windows with AppleScript.
  67.  
  68. pl2 - a script that illustrates how to filter text in the channel out into a separate window.
  69.  
  70. SendRequestedSound - used internally by Snak to implement the function that will send a requested sound to someone if they send you a  "!<yournick> <soundname>" message. Loaded and unloaded automatically. Please do not delete. 
  71.  
  72. SnakEventHandlers - example script file containing examples of all the event handlers that Snak supports.
  73.  
  74. TempConv - useful script that provides automatic temperature conversion between F and C. If you load this script it will automatically respond whenever someone says "!tempconv F to C <temp>" or "!tempconv C to F <temp>" and convert the temperature. The technique used in this script can be used to implement sophisticated "bots" to provide channel services.
  75.  
  76.  
  77. Script Library:
  78. If you write a cool or useful script for Snak, please send it to me. I will then look it over and upload it to the script library page on the website at http://www.snak.com/ScriptLibrary.html
  79.  
  80. You can send it to me at kents@snak.com
  81.  
  82. Have fun with Scripting and be sure to let me know if you find a bug or need a specific functionality that is not currently implemented.
  83.  
  84.  
  85.